﻿@page "/diaryCardSetting"
@namespace SwashbucklerDiary.Rcl.Pages
@inherits ImportantComponentBase

<MyAppBar Title="@(I18n.T("Setting.Display.DiaryCard.Name"))"
          OnClick="NavigateToBack">
</MyAppBar>

<ScrollContainer>
    <MCard Class="my-list-card"
           Elevation="0"
           Rounded="@("lg")">
        <MList>
            <MListItem>
                <MListItemIcon>
                    <MIcon Class="evident-icon">
                        mdi-emoticon-happy-outline
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.DiaryCard.Icon.Name"))
                </MListItemContent>
                <MListItemAction>
                    <SettingSwitch @bind-Value="diaryCardIcon"
                                   SettingKey="@nameof(Setting.DiaryCardIcon)">
                    </SettingSwitch>
                </MListItemAction>
            </MListItem>

            <MDivider Class="mx-5"></MDivider>

            <MListItem>
                <MListItemIcon>
                    <MIcon Class="evident-icon">
                        mdi-label-outline
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.DiaryCard.Tags.Name"))
                </MListItemContent>
                <MListItemAction>
                    <SettingSwitch @bind-Value="diaryCardTags"
                                   SettingKey="@nameof(Setting.DiaryCardTags)">
                    </SettingSwitch>
                </MListItemAction>
            </MListItem>

            <MDivider Class="mx-5"></MDivider>

            <MListItem>
                <MListItemIcon>
                    <MIcon Class="evident-icon">
                        mdi-map-marker-outline
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.DiaryCard.Location.Name"))
                </MListItemContent>
                <MListItemAction>
                    <SettingSwitch @bind-Value="diaryCardLocation"
                                   SettingKey="@nameof(Setting.DiaryCardLocation)">
                    </SettingSwitch>
                </MListItemAction>
            </MListItem>

            <MDivider Class="mx-5"></MDivider>

            <MListItem OnClick="@(()=>showDiaryCardTimeFormat=true)">
                <MListItemIcon>
                    <MIcon Class="evident-icon">
                        mdi-calendar-clock
                    </MIcon>
                </MListItemIcon>
                <MListItemContent>
                    @(I18n.T("Setting.Display.DiaryCard.TimeFormat.Name"))
                </MListItemContent>
                <MListItemContent Class="setting-item-state">
                    <MListItemSubtitle>
                        @(I18n.T(DiaryCardTimeFormatKey))
                    </MListItemSubtitle>
                </MListItemContent>
                <MListItemAction>
                    <MIcon>mdi-chevron-right</MIcon>
                </MListItemAction>
            </MListItem>
        </MList>
    </MCard>
</ScrollContainer>

<RadioDialog @bind-Value="DiaryCardTimeFormat"
             @bind-Visible="showDiaryCardTimeFormat"
             Title="@(I18n.T("Setting.Display.DiaryCard.TimeFormat.Name"))"
             TItemValue="string"
             TItem="KeyValuePair<string,string>"
             OnChange="DiaryCardTimeFormatChanged"
             Items="DiaryCardTimeFormats">
</RadioDialog>
